<template>	<view class="userinfo">		<view class="imageCover" @tap="openUser">			<image :src="userinfo.avatar ? userinfo.avatar : '/static/avatar/default_avatar.png'"
			 class="image"></image>		</view>		<view class="right">			<text class="username">{{userinfo.nickname?userinfo.nickname:userinfo.username}}</text>			<view class="account_content">				<text class="account">boyi号: {{userinfo.username}}</text>				<view class="icon_content" @tap="openCode">					<text class="iconfont icon">&#xe7a0;</text>					<text class="iconfont row icon">&#xe65f;</text>				</view>			</view>			<view class="autograph">				<text class="text">签名:{{userinfo.sign}}</text>			</view>		</view>	</view>
</template>

<script setup>	const prop = defineProps({		userinfo:{			type:Object,			default:() =>{}		}	})
	
	// 打开个人二维码
	const openCode = () => {
		// console.log(prop.userinfo);
		prop.userinfo.type = 'user'
		console.log('二维码');
		uni.navigateTo({
			url:'/pages/code/code?info=' + encodeURIComponent(JSON.stringify(prop.userinfo))
		})
	}
	
	// 打开个人中心
	const openUser = () => {
		uni.navigateTo({
			url:'/pages/editUser/editUser'
		})
		console.log('个人中心');
	}
	
</script>

<style lang="less" scoped>	.userinfo{		height: 250rpx;		display: flex;		flex-direction: row;		padding-top: 30rpx;		padding-left: 30rpx;		padding-right: 30rpx;		background-color: #fff;		.imageCover{			margin-right: 10rpx;			.image{				width: 100rpx;				height: 100rpx;				border-radius: 10rpx;			}		}		.right{			flex: 1;			display: flex;			flex-direction: column;			.username{				color: #333;				font-size: 40rpx;				margin-bottom: 10rpx;			}			.account_content{				display: flex;				flex-direction: row;				justify-content: space-between;				.account{					color: #999;					font-size: 30rpx;				}				.icon_content{					display: flex;					flex-direction: row;					.row{						margin-left: 20rpx;					}					.icon{						color: #999;						font-size: 30rpx;					}				}			}			.autograph{				width: 550rpx;				display: flex;				flex-direction: row;				margin-top: 10rpx;				.text{					flex: 1;					height: 100rpx;					color: #999;					font-size: 30rpx;					overflow: hidden; 				}			}		}	}
</style>